Query('SELECT * FROM menu WHERE menu.parent="0" ORDER BY menu.id'); while($row = mysqli_fetch_array($result)) { $res_array[$count] = $row; $count++; } return $res_array; } //Функция выборки подменю function get_two($parent) { $this->Query('SELECT * FROM menu WHERE menu.parent="$parent" ORDER BY menu.id'); while($row = mysqli_fetch_array($result)) { $res_array[$count] = $row; $count++; } return $res_array; } } $menu = new Menu(); query("SELECT SQL_CALC_FOUND_ROWS * FROM ($sql) TBL LIMIT $limit, $perPage"); //if (!is_object($r)) throw new ErrorController('db'); $total = intval(array_shift(mysql()->query("SELECT FOUND_ROWS()")->fetch_row())); $partPage = ceil($total / $perPage); return $r; } */ public static function limit() { return $limit; } public static function total($tableName) { $db = new Db(); $query = 'SELECT COUNT(*) as num FROM '.$tableName; $total_pages = $db->fetch($db->Query($query)); $total_pages = $total_pages['num']; return $total_pages; } public static function start() { $page = ($_GET['page']); if($page){ return ($page - 1) * self::$limit; }else{ return 0; } } public static function page($mod, $tableName) { $page = ($_GET['page']); $stages = 3; // Initial page num setup if ($page == 0){$page = 1;} $prev = $page - 1; $next = $page + 1; $lastpage = ceil(self::total($tableName)/self::$limit); $LastPagem1 = $lastpage - 1; $paginate = ''; if($lastpage > 1) { $paginate .= '
"; } //echo $total_pages.' Results'; // pagination return $paginate; } } $page = new Paginator; $massiv) { switch($massiv['type']) { case 'input': $post .= '
'; break; case 'textarea': $label = ($massiv['title']) ? '' : '' ; $post .= '
'.(@$massiv['option'] == 1 ? $label : '' ).'
'.(@$massiv['option'] == 0 ? $label : '' ).'
'; break; case 'checkbox': $post .= '
'; foreach($massiv['checkbox'] as $k => $val) { $_POST['text'.$key][$k] = (!empty($_POST['text'.$key][$k])) ? $_POST['text'.$key][$k] : '' ; $post .= ''; } $post .= '
'; break; case 'radio': $post .= '
'; foreach($massiv['radio'] as $val) { $_POST['text'.$key] = (!empty($_POST['text'.$key])) ? $_POST['text'.$key] : '' ; $post .= ''; } $post .= '
'; break; case 'file': $post .= '
'; break; case 'header': $post .= '

'.$massiv['title'].'

'; break; case 'text': $post .= '

'.$massiv['title'].'

'; break; } } return $post; } }return_announcements(1); $sape = new SAPE_client($o); $sape_context = new SAPE_context($o); unset($o); $links['sape'] = $sape->return_links(); //$sapes = explode('|', $links['sape']); include_once($_SERVER['DOCUMENT_ROOT'].'/links/xrink/mainlink.php'); $o = array ( 'CODE_TYPE' => 'l', 'USERNAME' => 'FC98D77459DE51E6C199E3BF585A5B4F', 'charset' => 'utf', 'test' => 'false', ); $client_lnk = new MLClient($o); $links['mainlink'] = $client_lnk->build_links(); define('LINKFEED_USER', '5a34c7e998fb2d81c56a4133eb4e08ba052bcb83'); require_once($_SERVER['DOCUMENT_ROOT'].'/links/'.LINKFEED_USER.'/linkfeed.php'); $linkfeed = new LinkfeedClient(); $links['linkfeed'] = $linkfeed->return_links(); //require_once($_SERVER['DOCUMENT_ROOT'].'/links/setlinks_c30b3/slsimple.php'); ?> GetAll('select * from s_'.$_GET['mod']); foreach ($result as $ar) { $ar1['alias'] = $sef->str2url($ar['title_short']); $allowed = array('alias'); $data = $db->filterArray($ar1, $allowed); $sql = 'update ?n set ?u where id=?i'; $db->query($sql, 's_'.$_GET['mod'], $data, $ar['id']); } */ switch($_GET['option']) { case 'section': $title = 'Разные статьи'; $GLOBALS['breadcrumbs'][] = 'Разные статьи'; $content = '

Разные статьи

'; $content .= ''; $ar = $db->getAll('select * from s_states_category where parent_id=0 order by category_name'); if (!empty($ar)) { array_filter($ar); foreach ($ar as $key => $massiv) { $content .= ''; } } $content .= '
'.$massiv['category_name'].'
'; break; case 'category': $result = $db->query('SELECT * FROM s_states_category ORDER BY parent_id, list_order, category_name'); while($massiv = $db->fetch($result)) { $catall[$massiv['category_id']] = $massiv; } $cat = $db->getRow('select * from s_states_category where category_alias=?s', $_GET['alias']); $catid = $cat['category_id']; $title = $cat['category_name']; $GLOBALS['breadcrumbs'][] = 'Разные статьи'; if (!empty($cat['parent_id'])) { $parents = $cat['parent_id']; while ($parents <> 0) { $breadcrumbs_parents[] = ''.$catall[$parents]['category_name'].''; $parents = $catall[$parents]['parent_id']; } $breadcrumbs_parents = array_reverse($breadcrumbs_parents); $GLOBALS['breadcrumbs'] = array_merge($GLOBALS['breadcrumbs'], $breadcrumbs_parents); } $GLOBALS['breadcrumbs'][] = $cat['category_name']; $content = '

'.$cat['category_name'].'

'; $ar = $db->getAll('select * from s_states_category where parent_id=?s', $cat['category_id']); if (!empty($ar)) { array_filter($ar); $content .= ''; foreach ($ar as $key => $massiv) { $content .= ''; } $content .= '
'.$massiv['category_name'].'
'; } $ar = $db->getAll('select * from s_states_category where category_alias=?s', $_GET['alias']); foreach($ar as $key => $massiv) { if ($massiv['category_alias'] == $_GET['alias']) { if(strpos($massiv['category_description'], '
') === false) { $content .= shop::content_regex($massiv['category_description']); } else { $text = explode('
', $massiv['category_description']); $content .= $text[0]; } } } $content .= ''; $sql = $db->Query('select * from s_states where category_id=?i order by title_short', $catid); while ($ar = $db->fetch($sql)) { $content .= ''; } $content .= '
'.$ar['title_short'].' '.$ar['title'].'
'; $content .= ((!empty($text[1])) ? $text[1] : '' ) ; break; case 'view': $result = $db->query('SELECT * FROM s_states_category ORDER BY parent_id, list_order, category_name'); while($massiv = $db->fetch($result)) { $catall[$massiv['category_id']] = $massiv; } $sql = $db->Query('select * from s_states where alias=?s', $_GET['alias']); while ($ar = $db->fetch($sql)) { $breadcrumbs[] = 'Разные статьи'; $parents = $ar['category_id']; while ($parents <> 0) { $breadcrumbs_parents[] = ''.$catall[$parents]['category_name'].''; $parents = $catall[$parents]['parent_id']; } $breadcrumbs_parents = array_reverse($breadcrumbs_parents); $GLOBALS['breadcrumbs'] = array_merge($GLOBALS['breadcrumbs'], $breadcrumbs_parents); $title = $ar['title']; $breadcrumbs[] = Dir::cutStr($ar['title'], 100); $ar['body'] = $dir->links_index($ar['body'], $links); $ar['body'] = shop::content_regex($ar['body']); $text = explode('
', $ar['body']); $content .= '

'.$ar['title'].'

'; //(!$ar['short_text']) ? $content .= $ar['full_text'] : $content .= $ar['short_text']; if (Dir::cntglob(ROOT.'/files/'.$_GET['mod'].'/'.$ar['id'].'/*.*') == 1) { $content .= $text[0]. ((!empty($text[1])) ? $text[1] : '' ) ; } elseif (Dir::cntglob(ROOT.'/files/'.$_GET['mod'].'/'.$ar['id'].'/*.*') == 0) { $content .= $text[0]. ((!empty($text[1])) ? $text[1] : '' ) ; } else { $content .= $text[0].'
'. ((!empty($text[1])) ? $text[1] : '' ) ; } $content .= '
'; } //} break; } //$content .= '
';
    $a) { $w2 = ''; $in = ''; $active_id = (isset($active_id)) ? $active_id : '' ; if (isset($res[$a['id']])) { $w2 = '
      '; foreach ($res[$a['id']] as $key2 => $a2) { $active = ''; switch($_GET['option']) { case 'exp': if ($active_id == $a2['id']) { $active = 'active bold'; } if ($active_id == $a2['id']) { $in = 'in'; } break; case 'view': if ($active_id == $a2['id']) { $active = 'active bold'; } if ($active_id == $a2['id']) { $in = 'in'; } break; default: if ($_GET['id'] == $a2['id']) { $active = 'active bold'; } if ($params[2] == $a['id']) { $in = 'in'; } if ($params[2] == $a2['id']) { $in = 'in'; } break; } $w2 .= '
    • '.$a2['title'].'
    • '; } $w2 .= '
    '; } $active = ''; switch($_GET['option']) { case 'category': if ($_GET['id'] == $a['id']) { $active = 'active bold'; } break; } $w1 = '
  • '.$a['title'].''.$w2.'
  • '; echo $w1; ?>

    query('SELECT * FROM s_gost_category ORDER BY parent_id, list_order, category_name'); while($massiv = $db->fetch($result)) { $catall[$massiv['category_id']] = $massiv; } switch ($params[0]) { case 'armature': $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 5781-82", "ГОСТ 10884-94", "ГОСТ 30136-95") order by creation_date desc'); break; case 'beam': $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 8239-89", "ГОСТ 535-2005", "ГОСТ 19281-89", "ГОСТ 19425-74") order by creation_date desc'); break; case 'strip': $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 103-2006") order by creation_date desc'); break; case 'circle': $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 2590-88") order by creation_date desc'); break; case 'sheet': $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 8568-77", "ГОСТ 19904-90", "ГОСТ 17066-94", "ГОСТ 19903-74", "ГОСТ 7350-77", "ГОСТ 14918-80") order by creation_date desc'); break; case 'pipe': //"ГОСТ 3262-75", "ГОСТ 8639-82", "ГОСТ 8645-68", "ГОСТ 10704-91", "ГОСТ 9583-75" $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("") order by creation_date desc'); break; case 'channel': $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 8240-97", "ГОСТ 19425-74", "ГОСТ 8278-83", "ГОСТ 8281-80") order by creation_date desc'); break; case 'corner': $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 8509-93", "ГОСТ 8510-86", "ГОСТ 19771-93", "ГОСТ 19772-93") order by creation_date desc'); break; case 'grid': $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 23279-85") order by creation_date desc'); break; case 'profnastil': $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 24045-94", "ГОСТ 14918-80", "ГОСТ 19903-74", "ГОСТ 19904-90") order by creation_date desc'); break; default: $massiv = $db->getAll('SELECT * FROM s_gost where title_short in ("ГОСТ 5781-82", "ГОСТ 10884-94", "ГОСТ 30136-95", "ГОСТ 8239-89", "ГОСТ 535-2005", "ГОСТ 19281-89", "ГОСТ 19425-74", "ГОСТ 103-2006", "ГОСТ 2590-88", "ГОСТ 8568-77", "ГОСТ 19904-90", "ГОСТ 17066-94", "ГОСТ 19903-74", "ГОСТ 7350-77", "ГОСТ 14918-80", "ГОСТ 8240-97", "ГОСТ 19425-74", "ГОСТ 8278-83", "ГОСТ 8281-80", "ГОСТ 8509-93", "ГОСТ 8510-86", "ГОСТ 19771-93", "ГОСТ 19772-93", "ГОСТ 23279-85", "ГОСТ 24045-94", "ГОСТ 14918-80", "ГОСТ 19903-74", "ГОСТ 19904-90") order by rand() desc limit 0,2'); break; } foreach ($massiv as $ar) { echo '
  • '.$ar['title_short'].'
    '.$ar['title'].'
  • '; } ?>
'') { /* if (strstr($links['sape_article'], 'href')!==FALSE) { echo '
'.$links['sape_article'].'
'; } if (strstr($links['mainlink'], 'href')!==FALSE) { echo '
'.$links['mainlink'].'
'; } */ //} break; } ?>
'') { if($_SERVER['REQUEST_URI'] <> '/') { if (empty($GLOBALS['links_on'])) { if (!empty($links['sape'])) { if (strstr($links['sape'], 'href')!==FALSE) { echo '
'.$links['sape'].'
'; } } } } //} break; } ?>

    getAll('SELECT * FROM s_news order by creation_date desc limit 0,7'); foreach ($massiv as $ar) { echo '
  • '.$ar['date'].'   '.$ar['title'].'
  • '; } ?>
'') { if (strstr($links['linkfeed'], 'href')!==FALSE) { echo '
'.$links['linkfeed'].'
'; } //} break; } */ ?>
'basket') { ?>
Оформить заказ
Корзина:
Яндекс.Метрика